/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('schedulerx3', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CreateAppRequest {
  accessToken?: string(name='AccessToken', example='ltk1ZXHv6LvibZypFkPHzRA'),
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  enableLog?: boolean(name='EnableLog', example='true'),
  maxConcurrency?: int32(name='MaxConcurrency', example='10'),
  title?: string(name='Title', description='This parameter is required.'),
}

model CreateAppResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: {
    accessToken?: string(name='AccessToken', example='4a0fae835cd741f3b12376d8a5a8e549v3'),
    appGroupId?: long(name='AppGroupId', example='10'),
  }(name='Data'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='3835AA29-2298-5434-BC53-9CC377CDFD2C'),
  success?: boolean(name='Success', example='true'),
}

model CreateAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAppResponseBody(name='body'),
}

/**
 * @summary 创建应用
 *
 * @param request CreateAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAppResponse
 */
async function createAppWithOptions(request: CreateAppRequest, runtime: $RuntimeOptions): CreateAppResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.accessToken)) {
    body['AccessToken'] = request.accessToken;
  }
  if (!$isNull(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.enableLog)) {
    body['EnableLog'] = request.enableLog;
  }
  if (!$isNull(request.maxConcurrency)) {
    body['MaxConcurrency'] = request.maxConcurrency;
  }
  if (!$isNull(request.title)) {
    body['Title'] = request.title;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateApp',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建应用
 *
 * @param request CreateAppRequest
 * @return CreateAppResponse
 */
async function createApp(request: CreateAppRequest): CreateAppResponse {
  var runtime = new $RuntimeOptions{};
  return createAppWithOptions(request, runtime);
}

model CreateClusterRequest {
  clusterName?: string(name='ClusterName', description='This parameter is required.', example='qianxi-test-0812'),
  clusterSpec?: string(name='ClusterSpec', description='This parameter is required.', example='scx.dev.x1'),
  engineType?: string(name='EngineType', description='This parameter is required.', example='xxljob'),
  vSwitches?: [ 
    {
      vSwitchId?: string(name='VSwitchId', description='This parameter is required.', example='vsw-2ze745n3r2sfqtahhubpl'),
      zoneId?: string(name='ZoneId', description='This parameter is required.', example='cn-hangzhou-j'),
    }
  ](name='VSwitches', description='This parameter is required.'),
  vpcId?: string(name='VpcId', description='VPC id

This parameter is required.', example='vpc-aa1a18236n90rqhuhhnhh'),
}

model CreateClusterShrinkRequest {
  clusterName?: string(name='ClusterName', description='This parameter is required.', example='qianxi-test-0812'),
  clusterSpec?: string(name='ClusterSpec', description='This parameter is required.', example='scx.dev.x1'),
  engineType?: string(name='EngineType', description='This parameter is required.', example='xxljob'),
  vSwitchesShrink?: string(name='VSwitches', description='This parameter is required.'),
  vpcId?: string(name='VpcId', description='VPC id

This parameter is required.', example='vpc-aa1a18236n90rqhuhhnhh'),
}

model CreateClusterResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: {
    clusterId?: string(name='ClusterId', example='xxljob-b21969c2309'),
    orderId?: long(name='OrderId', example='229317760970086'),
  }(name='Data', description='-'),
  errorCode?: string(name='ErrorCode', example='INVALID_PARAMETER'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='B8733786-C045-59F1-8D79-99A52863F62D'),
  success?: boolean(name='Success', example='true'),
}

model CreateClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateClusterResponseBody(name='body'),
}

/**
 * @summary 创建集群
 *
 * @param tmpReq CreateClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateClusterResponse
 */
async function createClusterWithOptions(tmpReq: CreateClusterRequest, runtime: $RuntimeOptions): CreateClusterResponse {
  tmpReq.validate();
  var request = new CreateClusterShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.vSwitches)) {
    request.vSwitchesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.vSwitches, 'VSwitches', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.clusterName)) {
    body['ClusterName'] = request.clusterName;
  }
  if (!$isNull(request.clusterSpec)) {
    body['ClusterSpec'] = request.clusterSpec;
  }
  if (!$isNull(request.engineType)) {
    body['EngineType'] = request.engineType;
  }
  if (!$isNull(request.vSwitchesShrink)) {
    body['VSwitches'] = request.vSwitchesShrink;
  }
  if (!$isNull(request.vpcId)) {
    body['VpcId'] = request.vpcId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateCluster',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建集群
 *
 * @param request CreateClusterRequest
 * @return CreateClusterResponse
 */
async function createCluster(request: CreateClusterRequest): CreateClusterResponse {
  var runtime = new $RuntimeOptions{};
  return createClusterWithOptions(request, runtime);
}

model CreateJobRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  attemptInterval?: int32(name='AttemptInterval', example='3'),
  calendar?: string(name='Calendar', example='workday'),
  childJobId?: string(name='ChildJobId'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  description?: string(name='Description', example='test'),
  executorBlockStrategy?: int32(name='ExecutorBlockStrategy', example='1'),
  jobHandler?: string(name='JobHandler', description='This parameter is required.', example='testJobVoidHandler'),
  jobType?: string(name='JobType', description='This parameter is required.', example='xxljob'),
  maxAttempt?: int32(name='MaxAttempt', example='3'),
  maxConcurrency?: int32(name='MaxConcurrency', example='1'),
  name?: string(name='Name', description='This parameter is required.', example='test-job'),
  noticeConfig?: {
    failEnable?: boolean(name='FailEnable', example='true'),
    failLimitTimes?: int32(name='FailLimitTimes', example='1'),
    missWorkerEnable?: boolean(name='MissWorkerEnable', example='true'),
    sendChannel?: string(name='SendChannel', example='mail'),
    successNotice?: boolean(name='SuccessNotice', example='true'),
    timeout?: long(name='Timeout', example='30'),
    timeoutEnable?: boolean(name='TimeoutEnable', example='true'),
    timeoutKillEnable?: boolean(name='TimeoutKillEnable', example='true'),
  }(name='NoticeConfig'),
  noticeContacts?: [ 
    {
      contactType?: int32(name='ContactType', example='1'),
      name?: string(name='Name', example='xiaoming'),
    }
  ](name='NoticeContacts'),
  parameters?: string(name='Parameters', example='test'),
  priority?: int32(name='Priority', example='5'),
  routeStrategy?: int32(name='RouteStrategy', example='1'),
  startTime?: long(name='StartTime', example='1701310327000'),
  status?: int32(name='Status', example='1'),
  timeExpression?: string(name='TimeExpression', example='0 0 4 ? * Mon/1'),
  timeType?: int32(name='TimeType', description='This parameter is required.', example='-1'),
  timezone?: string(name='Timezone', example='GMT+8'),
}

model CreateJobShrinkRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  attemptInterval?: int32(name='AttemptInterval', example='3'),
  calendar?: string(name='Calendar', example='workday'),
  childJobId?: string(name='ChildJobId'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  description?: string(name='Description', example='test'),
  executorBlockStrategy?: int32(name='ExecutorBlockStrategy', example='1'),
  jobHandler?: string(name='JobHandler', description='This parameter is required.', example='testJobVoidHandler'),
  jobType?: string(name='JobType', description='This parameter is required.', example='xxljob'),
  maxAttempt?: int32(name='MaxAttempt', example='3'),
  maxConcurrency?: int32(name='MaxConcurrency', example='1'),
  name?: string(name='Name', description='This parameter is required.', example='test-job'),
  noticeConfigShrink?: string(name='NoticeConfig'),
  noticeContactsShrink?: string(name='NoticeContacts'),
  parameters?: string(name='Parameters', example='test'),
  priority?: int32(name='Priority', example='5'),
  routeStrategy?: int32(name='RouteStrategy', example='1'),
  startTime?: long(name='StartTime', example='1701310327000'),
  status?: int32(name='Status', example='1'),
  timeExpression?: string(name='TimeExpression', example='0 0 4 ? * Mon/1'),
  timeType?: int32(name='TimeType', description='This parameter is required.', example='-1'),
  timezone?: string(name='Timezone', example='GMT+8'),
}

model CreateJobResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: {
    jobId?: long(name='JobId', example='74'),
  }(name='Data', description='-'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='3835AA29-2298-5434-BC53-9CC377CDFD2C'),
  success?: boolean(name='Success', example='true'),
}

model CreateJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateJobResponseBody(name='body'),
}

/**
 * @summary 创建任务
 *
 * @param tmpReq CreateJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateJobResponse
 */
async function createJobWithOptions(tmpReq: CreateJobRequest, runtime: $RuntimeOptions): CreateJobResponse {
  tmpReq.validate();
  var request = new CreateJobShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.noticeConfig)) {
    request.noticeConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.noticeConfig, 'NoticeConfig', 'json');
  }
  if (!$isNull(tmpReq.noticeContacts)) {
    request.noticeContactsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.noticeContacts, 'NoticeContacts', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!$isNull(request.attemptInterval)) {
    body['AttemptInterval'] = request.attemptInterval;
  }
  if (!$isNull(request.calendar)) {
    body['Calendar'] = request.calendar;
  }
  if (!$isNull(request.childJobId)) {
    body['ChildJobId'] = request.childJobId;
  }
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.description)) {
    body['Description'] = request.description;
  }
  if (!$isNull(request.executorBlockStrategy)) {
    body['ExecutorBlockStrategy'] = request.executorBlockStrategy;
  }
  if (!$isNull(request.jobHandler)) {
    body['JobHandler'] = request.jobHandler;
  }
  if (!$isNull(request.jobType)) {
    body['JobType'] = request.jobType;
  }
  if (!$isNull(request.maxAttempt)) {
    body['MaxAttempt'] = request.maxAttempt;
  }
  if (!$isNull(request.maxConcurrency)) {
    body['MaxConcurrency'] = request.maxConcurrency;
  }
  if (!$isNull(request.name)) {
    body['Name'] = request.name;
  }
  if (!$isNull(request.noticeConfigShrink)) {
    body['NoticeConfig'] = request.noticeConfigShrink;
  }
  if (!$isNull(request.noticeContactsShrink)) {
    body['NoticeContacts'] = request.noticeContactsShrink;
  }
  if (!$isNull(request.parameters)) {
    body['Parameters'] = request.parameters;
  }
  if (!$isNull(request.priority)) {
    body['Priority'] = request.priority;
  }
  if (!$isNull(request.routeStrategy)) {
    body['RouteStrategy'] = request.routeStrategy;
  }
  if (!$isNull(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!$isNull(request.status)) {
    body['Status'] = request.status;
  }
  if (!$isNull(request.timeExpression)) {
    body['TimeExpression'] = request.timeExpression;
  }
  if (!$isNull(request.timeType)) {
    body['TimeType'] = request.timeType;
  }
  if (!$isNull(request.timezone)) {
    body['Timezone'] = request.timezone;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateJob',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建任务
 *
 * @param request CreateJobRequest
 * @return CreateJobResponse
 */
async function createJob(request: CreateJobRequest): CreateJobResponse {
  var runtime = new $RuntimeOptions{};
  return createJobWithOptions(request, runtime);
}

model DeleteAppRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
}

model DeleteAppResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='CF99C381-C8F6-5A8D-8C24-57F46B706D2D'),
  success?: boolean(name='Success', example='true'),
}

model DeleteAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAppResponseBody(name='body'),
}

/**
 * @summary 删除应用分组
 *
 * @param request DeleteAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAppResponse
 */
async function deleteAppWithOptions(request: DeleteAppRequest, runtime: $RuntimeOptions): DeleteAppResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteApp',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除应用分组
 *
 * @param request DeleteAppRequest
 * @return DeleteAppResponse
 */
async function deleteApp(request: DeleteAppRequest): DeleteAppResponse {
  var runtime = new $RuntimeOptions{};
  return deleteAppWithOptions(request, runtime);
}

model DeleteClusterRequest {
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-a1804a3226d'),
}

model DeleteClusterResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='F131C3E0-3FAA-5FA4-A6F3-E974D69EF3C5'),
  success?: boolean(name='Success', example='true'),
}

model DeleteClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteClusterResponseBody(name='body'),
}

/**
 * @summary 释放删除集群
 *
 * @param request DeleteClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteClusterResponse
 */
async function deleteClusterWithOptions(request: DeleteClusterRequest, runtime: $RuntimeOptions): DeleteClusterResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteCluster',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 释放删除集群
 *
 * @param request DeleteClusterRequest
 * @return DeleteClusterResponse
 */
async function deleteCluster(request: DeleteClusterRequest): DeleteClusterResponse {
  var runtime = new $RuntimeOptions{};
  return deleteClusterWithOptions(request, runtime);
}

model DeleteJobsRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobIds?: [ long ](name='JobIds', description='-'),
}

model DeleteJobsShrinkRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobIdsShrink?: string(name='JobIds', description='-'),
}

model DeleteJobsResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='91143E1D-E235-5BE0-9364-C2EE28FFB5A6'),
  success?: boolean(name='Success', example='true'),
}

model DeleteJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteJobsResponseBody(name='body'),
}

/**
 * @summary 批量删除任务
 *
 * @param tmpReq DeleteJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteJobsResponse
 */
async function deleteJobsWithOptions(tmpReq: DeleteJobsRequest, runtime: $RuntimeOptions): DeleteJobsResponse {
  tmpReq.validate();
  var request = new DeleteJobsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.jobIds)) {
    request.jobIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.jobIds, 'JobIds', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.jobIdsShrink)) {
    body['JobIds'] = request.jobIdsShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteJobs',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 批量删除任务
 *
 * @param request DeleteJobsRequest
 * @return DeleteJobsResponse
 */
async function deleteJobs(request: DeleteJobsRequest): DeleteJobsResponse {
  var runtime = new $RuntimeOptions{};
  return deleteJobsWithOptions(request, runtime);
}

model ExportJobsRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  exportJobType?: int32(name='ExportJobType', example='1'),
  jobIds?: [ long ](name='JobIds', description='-'),
}

model ExportJobsShrinkRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  exportJobType?: int32(name='ExportJobType', example='1'),
  jobIdsShrink?: string(name='JobIds', description='-'),
}

model ExportJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: bytes(name='body'),
}

/**
 * @summary 批量导出任务信息
 *
 * @param tmpReq ExportJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportJobsResponse
 */
async function exportJobsWithOptions(tmpReq: ExportJobsRequest, runtime: $RuntimeOptions): ExportJobsResponse {
  tmpReq.validate();
  var request = new ExportJobsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.jobIds)) {
    request.jobIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.jobIds, 'JobIds', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.exportJobType)) {
    body['ExportJobType'] = request.exportJobType;
  }
  if (!$isNull(request.jobIdsShrink)) {
    body['JobIds'] = request.jobIdsShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ExportJobs',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'byte',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 批量导出任务信息
 *
 * @param request ExportJobsRequest
 * @return ExportJobsResponse
 */
async function exportJobs(request: ExportJobsRequest): ExportJobsResponse {
  var runtime = new $RuntimeOptions{};
  return exportJobsWithOptions(request, runtime);
}

model GetClusterRequest {
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-d6a5243b6fa'),
}

model GetClusterResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: {
    chargeType?: string(name='ChargeType', example='POSTPAY'),
    clusterId?: string(name='ClusterId', example='xxljob-e0d018c6df8'),
    clusterName?: string(name='ClusterName', example='xxl-job-test-1730427575152'),
    clusterSpec?: string(name='ClusterSpec', example='scx.small.x2'),
    createTime?: string(name='CreateTime', example='2024-10-29 15:56:36'),
    endTime?: string(name='EndTime', example='2024-10-29 15:56:36'),
    engineType?: string(name='EngineType', example='xxljob'),
    engineVersion?: string(name='EngineVersion', example='2.0.0'),
    internetDomain?: string(name='InternetDomain'),
    intranetDomain?: string(name='IntranetDomain', example='http://xxljob-xxxxxx.schedulerx.mse.aliyuncs.com'),
    jobNum?: int32(name='JobNum', example='100'),
    kubeConfig?: string(name='KubeConfig', example='{
  "vSwitchIdList": [
    "xxx",
    "xxx"
  ],
  "cpu": xxx,
  "cpuUnit": "xxx",
  "diskCapacity": xxx,
  "memoryCapacity": xxx,
  "zoneIds": [
    "xxx",
    "xxx"
  ],
  "securityGroupList": [
    "xxx"
  ],
  "eniCrossZone": "xxx",
  "regionId": "xxx",
  "instanceCount": xxx,
  "vpcId": "xxx",
  "memoryUnit": "xxx",
  "diskType": "xxx",
  "appClusterId": "xxx"
}'),
    maxJobNum?: int32(name='MaxJobNum', example='1000'),
    productType?: int32(name='ProductType', example='2'),
    spm?: int32(name='Spm', example='10'),
    status?: int32(name='Status', example='2'),
    vSwitches?: [ 
      {
        vSwitchId?: string(name='VSwitchId', example='vsw-8vbf1n216nshvfjdyff8a'),
        zoneId?: string(name='ZoneId', example='cn-hangzhou-k'),
      }
    ](name='VSwitches'),
    versionLifecycle?: string(name='VersionLifecycle'),
    vpcId?: string(name='VpcId', description='VPC ID', example='vpc-bp1fiz967u39lt8yuxcs0'),
    workerNum?: int32(name='WorkerNum', example='10'),
    zones?: [ string ](name='Zones'),
  }(name='Data', description='-'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='D0DE9C33-992A-580B-89C4-B609A292748D'),
  success?: boolean(name='Success', example='true'),
}

model GetClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetClusterResponseBody(name='body'),
}

/**
 * @summary 获取集群详细信息
 *
 * @param request GetClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetClusterResponse
 */
async function getClusterWithOptions(request: GetClusterRequest, runtime: $RuntimeOptions): GetClusterResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetCluster',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取集群详细信息
 *
 * @param request GetClusterRequest
 * @return GetClusterResponse
 */
async function getCluster(request: GetClusterRequest): GetClusterResponse {
  var runtime = new $RuntimeOptions{};
  return getClusterWithOptions(request, runtime);
}

model GetDesigateInfoRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobId?: long(name='JobId', description='This parameter is required.', example='74'),
}

model GetDesigateInfoResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: {
    designateType?: int32(name='DesignateType', example='2'),
    transferable?: boolean(name='Transferable', example='true'),
  }(name='Data', description='-'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='1DF6732E-15D8-5E1F-95E3-C10077F556B5'),
  success?: boolean(name='Success', example='true'),
}

model GetDesigateInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDesigateInfoResponseBody(name='body'),
}

/**
 * @summary 获取指定机器信息
 *
 * @param request GetDesigateInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDesigateInfoResponse
 */
async function getDesigateInfoWithOptions(request: GetDesigateInfoRequest, runtime: $RuntimeOptions): GetDesigateInfoResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetDesigateInfo',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指定机器信息
 *
 * @param request GetDesigateInfoRequest
 * @return GetDesigateInfoResponse
 */
async function getDesigateInfo(request: GetDesigateInfoRequest): GetDesigateInfoResponse {
  var runtime = new $RuntimeOptions{};
  return getDesigateInfoWithOptions(request, runtime);
}

model GetJobExecutionProgressRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobExecutionId?: string(name='JobExecutionId', description='This parameter is required.', example='1310630367761285120'),
}

model GetJobExecutionProgressResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: {
    jobDescription?: string(name='JobDescription'),
    rootProgress?: {
      finished?: long(name='Finished', example='2'),
      total?: long(name='Total', example='2'),
    }(name='RootProgress'),
    shardingProgress?: [ 
      {
        id?: long(name='Id', description='id', example='1'),
        jobExecutionId?: string(name='JobExecutionId', example='1306189481388277762'),
        result?: string(name='Result', example='2,4,6,8,10'),
        status?: int32(name='Status', example='5'),
        statusType?: {
          code?: string(name='Code', example='5'),
          name?: string(name='Name', example='TaskStatus.FAILED'),
          tips?: map[string]string(name='Tips', description='-'),
        }(name='StatusType'),
        workerAddr?: string(name='WorkerAddr', example='http://192.168.1.9:9999/'),
      }
    ](name='ShardingProgress'),
    taskProgress?: [ 
      {
        failed?: int32(name='Failed', example='100'),
        name?: string(name='Name', example='calendar_test_2'),
        pulled?: int32(name='Pulled', example='10'),
        queue?: int32(name='Queue', example='100'),
        running?: int32(name='Running', example='1'),
        success?: int32(name='Success', example='100'),
        total?: int32(name='Total', example='1000'),
      }
    ](name='TaskProgress'),
    totalProgress?: {
      finished?: long(name='Finished', example='15'),
      total?: long(name='Total', example='30'),
    }(name='TotalProgress'),
    workerProgress?: [ 
      {
        failed?: int32(name='Failed', example='20'),
        pulled?: int32(name='Pulled', example='20'),
        queue?: int32(name='Queue', example='20'),
        running?: int32(name='Running', example='20'),
        success?: int32(name='Success', example='20'),
        total?: int32(name='Total', example='100'),
        traceId?: string(name='TraceId', example='1a0e97fb17244665327205402dbd6d'),
        workerAddr?: string(name='WorkerAddr', example='10.10.116.53:61941'),
      }
    ](name='WorkerProgress'),
  }(name='Data', description='-'),
  message?: string(name='Message', example='Parameter format error'),
  requestId?: string(name='RequestId', example='9B57FDD7-ABBE-5030-B348-86EB9943DB59'),
  success?: boolean(name='Success', example='true'),
}

model GetJobExecutionProgressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJobExecutionProgressResponseBody(name='body'),
}

/**
 * @summary 获取任务执行的详情
 *
 * @param request GetJobExecutionProgressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetJobExecutionProgressResponse
 */
async function getJobExecutionProgressWithOptions(request: GetJobExecutionProgressRequest, runtime: $RuntimeOptions): GetJobExecutionProgressResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetJobExecutionProgress',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取任务执行的详情
 *
 * @param request GetJobExecutionProgressRequest
 * @return GetJobExecutionProgressResponse
 */
async function getJobExecutionProgress(request: GetJobExecutionProgressRequest): GetJobExecutionProgressResponse {
  var runtime = new $RuntimeOptions{};
  return getJobExecutionProgressWithOptions(request, runtime);
}

model GetLogRequest {
  appName?: string(name='AppName', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  endTime?: long(name='EndTime', example='1721636220'),
  jobExecutionId?: string(name='JobExecutionId', example='1310630367761285120'),
  keyword?: string(name='Keyword', example='hello word'),
  level?: string(name='Level', example='INFO'),
  lineNum?: int32(name='LineNum', description='LineNum', example='2'),
  logId?: long(name='LogId', example='344008'),
  offset?: int32(name='Offset', example='0'),
  reverse?: boolean(name='Reverse', example='true'),
  startTime?: long(name='StartTime', example='1721636220'),
}

model GetLogResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: [ string ](name='Data', description='-'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='C78E2AD2-5985-515B-BAD2-31A248AFC263'),
  success?: boolean(name='Success', example='true'),
}

model GetLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetLogResponseBody(name='body'),
}

/**
 * @summary 查询日志
 *
 * @param request GetLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetLogResponse
 */
async function getLogWithOptions(request: GetLogRequest, runtime: $RuntimeOptions): GetLogResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetLog',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询日志
 *
 * @param request GetLogRequest
 * @return GetLogResponse
 */
async function getLog(request: GetLogRequest): GetLogResponse {
  var runtime = new $RuntimeOptions{};
  return getLogWithOptions(request, runtime);
}

model ImportCalendarRequest {
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  months?: string(name='Months', description='This parameter is required.', example='[{"month":1,"days":[3,4,5,6,9,10,11,12,13,16,17,18,19,20,28,29,30,31]},{"month":2,"days":[1,2,3,6,7,8,9,10,13,14,15,16,17,20,21,22,23,24,27,28]},{"month":3,"days":[1,2,3,6,7,8,9,10,13,14,15,16,17,20,21,22,23,24,27,28,29,30,31]},{"month":4,"days":[3,4,6,7,10,11,12,13,14,17,18,19,20,21,23,24,25,26,27,28]},{"month":5,"days":[4,5,6,8,9,10,11,12,15,16,17,18,19,22,23,24,25,26,29,30,31]},{"month":6,"days":[1,2,5,6,7,8,9,12,13,14,15,16,19,20,21,25,26,27,28,29,30]},{"month":7,"days":[3,4,5,6,7,10,11,12,13,14,17,18,19,20,21,24,25,26,27,28,31]},{"month":8,"days":[1,2,3,4,7,8,9,10,11,14,15,16,17,18,21,22,23,24,25,28,29,30,31]},{"month":9,"days":[1,4,5,6,7,8,11,12,13,14,15,18,19,20,21,22,25,26,27,28]},{"month":10,"days":[7,8,9,10,11,12,13,16,17,18,19,20,23,24,25,26,27,30,31]},{"month":11,"days":[1,2,3,6,7,8,9,10,13,14,15,16,17,20,21,22,23,24,27,28,29,30]},{"month":12,"days":[1,4,5,6,7,8,11,12,13,14,15,18,19,20,21,22,25,26,27,28,29]}]'),
  name?: string(name='Name', description='This parameter is required.', example='workday'),
  year?: int32(name='Year', description='This parameter is required.', example='2024'),
}

model ImportCalendarResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: [ string ](name='Data', description='-'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='2ECA6FC9-7557-5576-AF5F-FC3E7BCC9C21'),
  success?: boolean(name='Success', example='true'),
}

model ImportCalendarResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ImportCalendarResponseBody(name='body'),
}

/**
 * @summary 导入日历
 *
 * @param request ImportCalendarRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ImportCalendarResponse
 */
async function importCalendarWithOptions(request: ImportCalendarRequest, runtime: $RuntimeOptions): ImportCalendarResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.months)) {
    body['Months'] = request.months;
  }
  if (!$isNull(request.name)) {
    body['Name'] = request.name;
  }
  if (!$isNull(request.year)) {
    body['Year'] = request.year;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ImportCalendar',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 导入日历
 *
 * @param request ImportCalendarRequest
 * @return ImportCalendarResponse
 */
async function importCalendar(request: ImportCalendarRequest): ImportCalendarResponse {
  var runtime = new $RuntimeOptions{};
  return importCalendarWithOptions(request, runtime);
}

model ImportJobsRequest {
  autoCreateApp?: boolean(name='AutoCreateApp', example='true'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  content?: string(name='Content', example='{
  "kind": "SchedulerXJobs",
  "type": "JSON",
  "version": "2.0",
  "content": [
    {
      "appName": "xxl-job-executor-perf-test-xx",
      "groupId": "xxl-job-executor-perf-test-xx",
      "description": "xxl-job-executor-xx",
      "jobConfigInfo": [
        {
          "jobHandler": "testJobVoidHandler",
          "dataOffset": 0,
          "executeMode": "standalone",
          "monitorConfigInfo": {
            "alarmType": "CustomContacts",
            "failLimitTimes": 1,
            "failEnable": true,
            "failRate": 100,
            "timeoutKillEnable": false,
            "missWorkerEnable": false,
            "sendChannel": "webhook",
            "timeoutEnable": true,
            "timeout": 7200,
            "daysOfDeadline": 0,
            "successNotice": false
          },
          "attemptInterval": 30,
          "cleanMode": "{\\\\"cleanMode\\\\":\\\\"NUM_ONLY\\\\",\\\\"totalRemain\\\\":300}",
          "description": "",
          "routeStrategy": 1,
          "userName": "xx",
          "userId": "xx",
          "content": "{\\\\"jobHandler\\\\":\\\\"testJobVoidHandler\\\\"}",
          "maxConcurrency": 1,
          "maxAttempt": 0,
          "name": "perf_auto_test_0",
          "xattrs": "",
          "jobType": "xxljob",
          "contentType": 1,
          "parameters": "success-withMsg",
          "timeConfig": {
            "calendar": "",
            "dataOffset": 0,
            "timeType": 1,
            "paramMap": {},
            "timeExpression": "* * * * * ?"
          },
          "contactInfoList": [],
          "status": 0
        }
      ]
    }
  ]
}'),
  overwrite?: boolean(name='Overwrite', example='true'),
}

model ImportJobsResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='9A48E22F-F30A-5CE5-AC7A-E0FED1B6942E'),
  success?: boolean(name='Success', example='true'),
}

model ImportJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ImportJobsResponseBody(name='body'),
}

/**
 * @summary 批量导入任务
 *
 * @param request ImportJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ImportJobsResponse
 */
async function importJobsWithOptions(request: ImportJobsRequest, runtime: $RuntimeOptions): ImportJobsResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.autoCreateApp)) {
    body['AutoCreateApp'] = request.autoCreateApp;
  }
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.content)) {
    body['Content'] = request.content;
  }
  if (!$isNull(request.overwrite)) {
    body['Overwrite'] = request.overwrite;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ImportJobs',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 批量导入任务
 *
 * @param request ImportJobsRequest
 * @return ImportJobsResponse
 */
async function importJobs(request: ImportJobsRequest): ImportJobsResponse {
  var runtime = new $RuntimeOptions{};
  return importJobsWithOptions(request, runtime);
}

model ListAlarmEventRequest {
  alarmChannel?: string(name='AlarmChannel', example='webhook'),
  alarmStatus?: string(name='AlarmStatus', example='true'),
  alarmType?: string(name='AlarmType', example='schedulerx3_fail_alarm'),
  appName?: string(name='AppName', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  endTime?: long(name='EndTime', example='1731636011558'),
  jobName?: string(name='JobName', example='test-job'),
  pageNum?: string(name='PageNum', example='1'),
  pageSize?: string(name='PageSize', example='10'),
  reverse?: boolean(name='Reverse', example='true'),
  startTime?: long(name='StartTime', example='1690419316000'),
}

model ListAlarmEventResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: {
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='20'),
    records?: [ 
      {
        alarmChannel?: string(name='AlarmChannel', example='webhook'),
        alarmContacts?: string(name='AlarmContacts', example='zhangsan'),
        alarmMessage?: string(name='AlarmMessage'),
        alarmStatus?: string(name='AlarmStatus', example='true'),
        alarmType?: string(name='AlarmType', example='schedulerx3_fail_alarm'),
        appName?: string(name='AppName', example='test-app'),
        jobName?: string(name='JobName', example='test-job'),
        time?: string(name='Time', example='2024-10-31 16:43:51'),
      }
    ](name='Records'),
    total?: long(name='Total', example='64'),
  }(name='Data', description='-'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='27B1345D-5F71-5972-8E4C-AABA6C6232F0'),
  success?: boolean(name='Success', example='true'),
}

model ListAlarmEventResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAlarmEventResponseBody(name='body'),
}

/**
 * @summary 获取报警事件
 *
 * @param request ListAlarmEventRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAlarmEventResponse
 */
async function listAlarmEventWithOptions(request: ListAlarmEventRequest, runtime: $RuntimeOptions): ListAlarmEventResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAlarmEvent',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取报警事件
 *
 * @param request ListAlarmEventRequest
 * @return ListAlarmEventResponse
 */
async function listAlarmEvent(request: ListAlarmEventRequest): ListAlarmEventResponse {
  var runtime = new $RuntimeOptions{};
  return listAlarmEventWithOptions(request, runtime);
}

model ListAppNamesRequest {
  appName?: string(name='AppName', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
}

model ListAppNamesResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: [ 
    {
      appGroupId?: string(name='AppGroupId', example='test-app'),
      appName?: string(name='AppName', example='test-app'),
      id?: long(name='Id', example='15'),
      title?: string(name='Title'),
    }
  ](name='Data', description='.'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='3881C59F-59F1-5B2E-8110-7D689CA9B207'),
  success?: boolean(name='Success', example='true'),
}

model ListAppNamesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppNamesResponseBody(name='body'),
}

/**
 * @summary 获取应用名字列表
 *
 * @param request ListAppNamesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppNamesResponse
 */
async function listAppNamesWithOptions(request: ListAppNamesRequest, runtime: $RuntimeOptions): ListAppNamesResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAppNames',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取应用名字列表
 *
 * @param request ListAppNamesRequest
 * @return ListAppNamesResponse
 */
async function listAppNames(request: ListAppNamesRequest): ListAppNamesResponse {
  var runtime = new $RuntimeOptions{};
  return listAppNamesWithOptions(request, runtime);
}

model ListAppsRequest {
  appName?: string(name='AppName', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  pageNum?: int32(name='PageNum', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  title?: string(name='Title'),
}

model ListAppsResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: {
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    records?: [ 
      {
        accessToken?: string(name='AccessToken', description='AccessToken', example='2f4ddeab8e344ed68e0402cf9b8502ffv3'),
        appName?: string(name='AppName', example='test-app'),
        creator?: string(name='Creator', example='1827811800555555'),
        enableLog?: boolean(name='EnableLog', example='true'),
        executorNum?: long(name='ExecutorNum', example='1'),
        id?: long(name='Id', example='43885'),
        jobNum?: int32(name='JobNum', example='10'),
        leader?: string(name='Leader', example='http://28.5.128.3:80'),
        maxConcurrency?: int32(name='MaxConcurrency', example='100'),
        maxJobs?: int32(name='MaxJobs', example='1000'),
        title?: string(name='Title'),
        updater?: string(name='Updater', example='1827811800555555'),
      }
    ](name='Records', description='-'),
    total?: int32(name='Total', example='10'),
  }(name='Data', description='-'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='2C3E52FF-CBE9-5C0E-8252-37ACFF1F5EFF'),
  success?: boolean(name='Success', example='true'),
}

model ListAppsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppsResponseBody(name='body'),
}

/**
 * @param request ListAppsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppsResponse
 */
async function listAppsWithOptions(request: ListAppsRequest, runtime: $RuntimeOptions): ListAppsResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListApps',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListAppsRequest
 * @return ListAppsResponse
 */
async function listApps(request: ListAppsRequest): ListAppsResponse {
  var runtime = new $RuntimeOptions{};
  return listAppsWithOptions(request, runtime);
}

model ListCalendarNamesRequest {
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
}

model ListCalendarNamesResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: [ string ](name='Data', description='-'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='AA3538A0-FBE6-5E31-AD88-A02C6FF0DACC'),
  success?: boolean(name='Success', example='true'),
}

model ListCalendarNamesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCalendarNamesResponseBody(name='body'),
}

/**
 * @summary 获取日历名字列表
 *
 * @param request ListCalendarNamesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCalendarNamesResponse
 */
async function listCalendarNamesWithOptions(request: ListCalendarNamesRequest, runtime: $RuntimeOptions): ListCalendarNamesResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListCalendarNames',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取日历名字列表
 *
 * @param request ListCalendarNamesRequest
 * @return ListCalendarNamesResponse
 */
async function listCalendarNames(request: ListCalendarNamesRequest): ListCalendarNamesResponse {
  var runtime = new $RuntimeOptions{};
  return listCalendarNamesWithOptions(request, runtime);
}

model ListClustersRequest {
  clusterId?: string(name='ClusterId', example='xxljob-d6a5243b6fa'),
  clusterName?: string(name='ClusterName', example='cluster-test'),
  pageNum?: int32(name='PageNum', example='5'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListClustersResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: {
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='50'),
    records?: [ 
      {
        chargeType?: string(name='ChargeType', example='PREPAY'),
        clusterId?: string(name='ClusterId', example='xxljob-c20f7ec9a78'),
        clusterName?: string(name='ClusterName', example='xxl-job-test-1730427510169'),
        clusterSpec?: string(name='ClusterSpec', example='scx.small.x2'),
        createTime?: string(name='CreateTime', example='2024-10-29 15:56:36'),
        endTime?: string(name='EndTime', example='2024-10-29 15:56:36'),
        engineType?: string(name='EngineType', example='xxljob'),
        engineVersion?: string(name='EngineVersion', example='2.0.0'),
        internetDomain?: string(name='InternetDomain'),
        intranetDomain?: string(name='IntranetDomain', example='http://xxljob-b9e19e46c4e.schedulerx.mse.aliyuncs.com'),
        productType?: int32(name='ProductType', example='1'),
        spInstanceId?: string(name='SpInstanceId'),
        status?: int32(name='Status', example='1'),
        vSwitches?: [ 
          {
            vSwitchId?: string(name='VSwitchId', example='vsw-8vbl54xzux86usy61r5zm'),
            zoneId?: string(name='ZoneId', example='cn-hangzhou-h'),
          }
        ](name='VSwitches'),
        versionLifecycle?: string(name='VersionLifecycle'),
        vpcId?: string(name='VpcId', description='VPC ID', example='vpc-bp1fxort6ag5h9752i305'),
      }
    ](name='Records', description='-'),
    total?: int32(name='Total', example='30'),
  }(name='Data', description='-'),
  message?: string(name='Message', description='This parameter is required.', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='39938688-0BAB-5AD8-BF02-F4910FAC7589'),
  success?: boolean(name='Success', example='true'),
}

model ListClustersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListClustersResponseBody(name='body'),
}

/**
 * @summary 查询实例列表
 *
 * @param request ListClustersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListClustersResponse
 */
async function listClustersWithOptions(request: ListClustersRequest, runtime: $RuntimeOptions): ListClustersResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListClusters',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询实例列表
 *
 * @param request ListClustersRequest
 * @return ListClustersResponse
 */
async function listClusters(request: ListClustersRequest): ListClustersResponse {
  var runtime = new $RuntimeOptions{};
  return listClustersWithOptions(request, runtime);
}

model ListExecutorsRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobId?: long(name='JobId', example='74'),
  label?: string(name='Label', example='gray'),
}

model ListExecutorsResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: [ 
    {
      address?: string(name='Address', example='http://192.168.1.10:9999/'),
      ip?: string(name='Ip', example='192.168.1.10'),
      isDesignated?: boolean(name='IsDesignated', example='true'),
      label?: string(name='Label', example='gray'),
      online?: boolean(name='Online', example='true'),
      port?: int32(name='Port', example='9999'),
      version?: string(name='Version', example='2.0.2'),
    }
  ](name='Data', description='-'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='5EF879D0-3B43-5AD1-9BF7-52418F9C5E73'),
  success?: boolean(name='Success', example='true'),
}

model ListExecutorsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExecutorsResponseBody(name='body'),
}

/**
 * @summary 查询Executor列表
 *
 * @param request ListExecutorsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExecutorsResponse
 */
async function listExecutorsWithOptions(request: ListExecutorsRequest, runtime: $RuntimeOptions): ListExecutorsResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListExecutors',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询Executor列表
 *
 * @param request ListExecutorsRequest
 * @return ListExecutorsResponse
 */
async function listExecutors(request: ListExecutorsRequest): ListExecutorsResponse {
  var runtime = new $RuntimeOptions{};
  return listExecutorsWithOptions(request, runtime);
}

model ListJobExecutionsRequest {
  appName?: string(name='AppName', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  endTime?: string(name='EndTime', example='2024-11-12 20:50:56'),
  jobExecutionId?: string(name='JobExecutionId', example='1310630367761285120'),
  jobId?: long(name='JobId', example='74'),
  jobName?: string(name='JobName', example='test-job'),
  pageNum?: int32(name='PageNum', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  startTime?: string(name='StartTime', example='2024-11-12 20:50:55'),
  status?: int32(name='Status', example='4'),
}

model ListJobExecutionsResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: {
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    records?: [ 
      {
        appName?: string(name='AppName', example='test-app'),
        attempt?: int32(name='Attempt', example='1'),
        dataTime?: string(name='DataTime', example='2024-11-12 14:52:42'),
        duration?: long(name='Duration', example='10'),
        endTime?: string(name='EndTime', example='2024-11-12 14:52:42'),
        executor?: string(name='Executor', example='1827811800526000'),
        jobExecutionId?: string(name='JobExecutionId', example='1310630367761285120'),
        jobId?: long(name='JobId', example='74'),
        jobName?: string(name='JobName', example='test-job'),
        jobType?: string(name='JobType', example='xxljob'),
        parameters?: string(name='Parameters', example='name=zhangsan'),
        result?: string(name='Result', example='success'),
        routeStrategy?: int32(name='RouteStrategy', example='1'),
        scheduleTime?: string(name='ScheduleTime', example='2024-11-12 14:52:42'),
        serverIp?: string(name='ServerIp', example='28.0.168.46'),
        status?: int32(name='Status', example='4'),
        timeType?: int32(name='TimeType', example='1'),
        triggerType?: int32(name='TriggerType', example='1'),
        workAddr?: string(name='WorkAddr', example='http://192.168.1.9:9999/'),
      }
    ](name='Records', description='-'),
    total?: int32(name='Total', example='20'),
  }(name='Data', description='-'),
  message?: string(name='Message', description='This parameter is required.', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='6BCE89B3-E882-511D-9A75-D452A56EC4B1'),
  success?: boolean(name='Success', example='true'),
}

model ListJobExecutionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListJobExecutionsResponseBody(name='body'),
}

/**
 * @summary 获取任务实例列表
 *
 * @param request ListJobExecutionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListJobExecutionsResponse
 */
async function listJobExecutionsWithOptions(request: ListJobExecutionsRequest, runtime: $RuntimeOptions): ListJobExecutionsResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListJobExecutions',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取任务实例列表
 *
 * @param request ListJobExecutionsRequest
 * @return ListJobExecutionsResponse
 */
async function listJobExecutions(request: ListJobExecutionsRequest): ListJobExecutionsResponse {
  var runtime = new $RuntimeOptions{};
  return listJobExecutionsWithOptions(request, runtime);
}

model ListJobsRequest {
  appName?: string(name='AppName', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  description?: string(name='Description'),
  jobHandler?: string(name='JobHandler', example='jobDemoHandler'),
  jobId?: long(name='JobId', example='10'),
  jobName?: string(name='JobName', example='job01'),
  pageNum?: int32(name='PageNum', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  status?: string(name='Status', example='0'),
}

model ListJobsResponseBody = {
  code?: int32(name='Code'),
  data?: {
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='20'),
    records?: [ 
      {
        appName?: string(name='AppName', example='test-app'),
        attemptInterval?: int32(name='AttemptInterval', example='30'),
        calendar?: string(name='Calendar', example='work-day'),
        childJobId?: string(name='ChildJobId'),
        cleanMode?: string(name='CleanMode', example='{"cleanMode":"NUM_ONLY","totalRemain":300}'),
        creator?: string(name='Creator', example='1963096506470832'),
        currentExecuteStatus?: int32(name='CurrentExecuteStatus', example='3'),
        dataOffset?: int32(name='DataOffset', example='3'),
        description?: string(name='Description'),
        executorBlockStrategy?: string(name='ExecutorBlockStrategy'),
        jobHandler?: string(name='JobHandler', example='jobDemoHandler'),
        jobId?: long(name='JobId', example='74'),
        jobType?: string(name='JobType', example='xxljob'),
        lastExecuteEndTime?: string(name='LastExecuteEndTime'),
        lastExecuteStatus?: int32(name='LastExecuteStatus'),
        maxAttempt?: int32(name='MaxAttempt', example='5'),
        maxConcurrency?: int32(name='MaxConcurrency', example='100'),
        name?: string(name='Name', example='job01'),
        noticeConfig?: string(name='NoticeConfig', example='{"failLimitTimes":1,"failEnable":true,"timeoutKillEnable":false,"missWorkerEnable":true,"timeoutEnable":true,"sendChannel":"","timeout":300,"successNotice":false}'),
        noticeContacts?: string(name='NoticeContacts'),
        parameters?: string(name='Parameters', example='name=10'),
        priority?: int32(name='Priority', example='1'),
        routeStrategy?: int32(name='RouteStrategy', example='1'),
        status?: int32(name='Status', example='1'),
        timeExpression?: string(name='TimeExpression', example='0 0 12 * * ?'),
        timeType?: int32(name='TimeType', example='1'),
        timeZone?: string(name='TimeZone', example='HangKong'),
        timezone?: string(name='Timezone', example='HangKong'),
        updater?: string(name='Updater', example='1963096506470832'),
        xattrs?: string(name='Xattrs'),
      }
    ](name='Records', description='-'),
    total?: int32(name='Total', example='65'),
  }(name='Data', description='-'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListJobsResponseBody(name='body'),
}

/**
 * @param request ListJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListJobsResponse
 */
async function listJobsWithOptions(request: ListJobsRequest, runtime: $RuntimeOptions): ListJobsResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListJobs',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListJobsRequest
 * @return ListJobsResponse
 */
async function listJobs(request: ListJobsRequest): ListJobsResponse {
  var runtime = new $RuntimeOptions{};
  return listJobsWithOptions(request, runtime);
}

model ListLablesRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobId?: long(name='JobId', example='15'),
}

model ListLablesResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: [ 
    {
      isDesignated?: boolean(name='IsDesignated', example='true'),
      label?: string(name='Label', example='gray'),
      online?: boolean(name='Online', example='true'),
      size?: int32(name='Size', example='2'),
    }
  ](name='Data', description='-'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='9079A828-9138-50F1-801E-F2BC3D222A06'),
  success?: boolean(name='Success', example='true'),
}

model ListLablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLablesResponseBody(name='body'),
}

/**
 * @summary 获取executor的label列表
 *
 * @param request ListLablesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLablesResponse
 */
async function listLablesWithOptions(request: ListLablesRequest, runtime: $RuntimeOptions): ListLablesResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListLables',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取executor的label列表
 *
 * @param request ListLablesRequest
 * @return ListLablesResponse
 */
async function listLables(request: ListLablesRequest): ListLablesResponse {
  var runtime = new $RuntimeOptions{};
  return listLablesWithOptions(request, runtime);
}

model ListRegionZoneResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: [ 
    {
      localName?: string(name='LocalName', example='E'),
      zoneId?: string(name='ZoneId', description='zone id', example='cn-beijing-j'),
    }
  ](name='Data', description='-'),
  errorCode?: string(name='ErrorCode', example='IllegalRequest'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='438737AC-760A-57D9-B646-B7EF79426243'),
  success?: boolean(name='Success', example='true'),
}

model ListRegionZoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRegionZoneResponseBody(name='body'),
}

/**
 * @summary 获取可用区列表
 *
 * @param request ListRegionZoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRegionZoneResponse
 */
async function listRegionZoneWithOptions(runtime: $RuntimeOptions): ListRegionZoneResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'ListRegionZone',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取可用区列表
 *
 * @return ListRegionZoneResponse
 */
async function listRegionZone(): ListRegionZoneResponse {
  var runtime = new $RuntimeOptions{};
  return listRegionZoneWithOptions(runtime);
}

model ListRegionsResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter check error'),
  regions?: [ 
    {
      localName?: string(name='LocalName', example='China (Hangzhou)'),
      regionEndpoint?: string(name='RegionEndpoint', description='endpoint', example='schedulerx3.cn-hangzhou.aliyuncs.com'),
      regionId?: string(name='RegionId', example='cn-hangzhou'),
    }
  ](name='Regions', description='-'),
  requestId?: string(name='RequestId', example='AFD5B166-4A7D-50DF-91BF-EFAFD41F7335'),
  success?: boolean(name='Success', example='true'),
}

model ListRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRegionsResponseBody(name='body'),
}

/**
 * @summary 获取所有region列表
 *
 * @param request ListRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRegionsResponse
 */
async function listRegionsWithOptions(runtime: $RuntimeOptions): ListRegionsResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'ListRegions',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取所有region列表
 *
 * @return ListRegionsResponse
 */
async function listRegions(): ListRegionsResponse {
  var runtime = new $RuntimeOptions{};
  return listRegionsWithOptions(runtime);
}

model ListScheduleEventRequest {
  appName?: string(name='AppName', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  endTime?: long(name='EndTime', example='1728872796295'),
  event?: string(name='Event', example='INFO'),
  jobExecutionId?: string(name='JobExecutionId', example='1310630367761285120'),
  jobName?: string(name='JobName', example='test-job'),
  keyword?: string(name='Keyword', example='hello word'),
  pageNum?: int32(name='PageNum', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  reverse?: boolean(name='Reverse', example='true'),
  startTime?: long(name='StartTime', example='1581317873000'),
}

model ListScheduleEventResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: {
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    records?: [ 
      {
        appName?: string(name='AppName', example='test-app'),
        content?: string(name='Content', example='hello word'),
        event?: string(name='Event', example='INFO'),
        jobExecutionId?: string(name='JobExecutionId', description='130', example='1310630367761285120'),
        jobName?: string(name='JobName', example='test-job'),
        time?: string(name='Time', example='2024-10-31 16:43:51'),
        workerAddr?: string(name='WorkerAddr', example='http://192.168.1.5:9999/'),
      }
    ](name='Records'),
    total?: long(name='Total', example='100'),
  }(name='Data', description='-'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='B880122A-B0E4-52E8-8F54-87DB7779EB74'),
  success?: boolean(name='Success', example='true'),
}

model ListScheduleEventResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListScheduleEventResponseBody(name='body'),
}

/**
 * @summary 查询调度事件
 *
 * @param request ListScheduleEventRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListScheduleEventResponse
 */
async function listScheduleEventWithOptions(request: ListScheduleEventRequest, runtime: $RuntimeOptions): ListScheduleEventResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListScheduleEvent',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询调度事件
 *
 * @param request ListScheduleEventRequest
 * @return ListScheduleEventResponse
 */
async function listScheduleEvent(request: ListScheduleEventRequest): ListScheduleEventResponse {
  var runtime = new $RuntimeOptions{};
  return listScheduleEventWithOptions(request, runtime);
}

model ListScheduleTimesRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  calendar?: string(name='Calendar', example='workday'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  timeExpression?: string(name='TimeExpression', description='This parameter is required.', example='0 0/10 * * * ?'),
  timeType?: int32(name='TimeType', description='This parameter is required.', example='1'),
  timeZone?: string(name='TimeZone', example='Asia/Beijing'),
}

model ListScheduleTimesResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: [ string ](name='Data'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='9A48E22F-F30A-5CE5-AC7A-E0FED1B6942E'),
  success?: boolean(name='Success', example='true'),
}

model ListScheduleTimesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListScheduleTimesResponseBody(name='body'),
}

/**
 * @summary 获取指定时间类型和表达式未来5次调度时间
 *
 * @param request ListScheduleTimesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListScheduleTimesResponse
 */
async function listScheduleTimesWithOptions(request: ListScheduleTimesRequest, runtime: $RuntimeOptions): ListScheduleTimesResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListScheduleTimes',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指定时间类型和表达式未来5次调度时间
 *
 * @param request ListScheduleTimesRequest
 * @return ListScheduleTimesResponse
 */
async function listScheduleTimes(request: ListScheduleTimesRequest): ListScheduleTimesResponse {
  var runtime = new $RuntimeOptions{};
  return listScheduleTimesWithOptions(request, runtime);
}

model OperateDesignateExecutorsRequest {
  addressList?: [ string ](name='AddressList', description='This parameter is required.'),
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  designateType?: int32(name='DesignateType', description='This parameter is required.', example='1'),
  jobId?: long(name='JobId', description='This parameter is required.', example='74'),
  transferable?: boolean(name='Transferable', example='true'),
}

model OperateDesignateExecutorsShrinkRequest {
  addressListShrink?: string(name='AddressList', description='This parameter is required.'),
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  designateType?: int32(name='DesignateType', description='This parameter is required.', example='1'),
  jobId?: long(name='JobId', description='This parameter is required.', example='74'),
  transferable?: boolean(name='Transferable', example='true'),
}

model OperateDesignateExecutorsResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='AFD5B166-4A7D-50DF-91BF-EFAFD41F7335'),
  success?: boolean(name='Success', example='true'),
}

model OperateDesignateExecutorsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OperateDesignateExecutorsResponseBody(name='body'),
}

/**
 * @summary 指定执行器
 *
 * @param tmpReq OperateDesignateExecutorsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OperateDesignateExecutorsResponse
 */
async function operateDesignateExecutorsWithOptions(tmpReq: OperateDesignateExecutorsRequest, runtime: $RuntimeOptions): OperateDesignateExecutorsResponse {
  tmpReq.validate();
  var request = new OperateDesignateExecutorsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.addressList)) {
    request.addressListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.addressList, 'AddressList', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.addressListShrink)) {
    body['AddressList'] = request.addressListShrink;
  }
  if (!$isNull(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.designateType)) {
    body['DesignateType'] = request.designateType;
  }
  if (!$isNull(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  if (!$isNull(request.transferable)) {
    body['Transferable'] = request.transferable;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'OperateDesignateExecutors',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 指定执行器
 *
 * @param request OperateDesignateExecutorsRequest
 * @return OperateDesignateExecutorsResponse
 */
async function operateDesignateExecutors(request: OperateDesignateExecutorsRequest): OperateDesignateExecutorsResponse {
  var runtime = new $RuntimeOptions{};
  return operateDesignateExecutorsWithOptions(request, runtime);
}

model OperateDisableJobsRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobIds?: [ long ](name='JobIds', description='-'),
}

model OperateDisableJobsShrinkRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobIdsShrink?: string(name='JobIds', description='-'),
}

model OperateDisableJobsResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='29ED6209-5DE6-5E1D-89B0-B7B1D823A1BF'),
  success?: boolean(name='Success', example='true'),
}

model OperateDisableJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OperateDisableJobsResponseBody(name='body'),
}

/**
 * @summary 批量禁用任务
 *
 * @param tmpReq OperateDisableJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OperateDisableJobsResponse
 */
async function operateDisableJobsWithOptions(tmpReq: OperateDisableJobsRequest, runtime: $RuntimeOptions): OperateDisableJobsResponse {
  tmpReq.validate();
  var request = new OperateDisableJobsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.jobIds)) {
    request.jobIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.jobIds, 'JobIds', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.jobIdsShrink)) {
    body['JobIds'] = request.jobIdsShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'OperateDisableJobs',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 批量禁用任务
 *
 * @param request OperateDisableJobsRequest
 * @return OperateDisableJobsResponse
 */
async function operateDisableJobs(request: OperateDisableJobsRequest): OperateDisableJobsResponse {
  var runtime = new $RuntimeOptions{};
  return operateDisableJobsWithOptions(request, runtime);
}

model OperateEnableJobsRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobIds?: [ long ](name='JobIds', description='-'),
}

model OperateEnableJobsShrinkRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobIdsShrink?: string(name='JobIds', description='-'),
}

model OperateEnableJobsResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='4CC4132F-B798-5D6E-9F06-D44B33E417E9'),
  success?: boolean(name='Success', example='true'),
}

model OperateEnableJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OperateEnableJobsResponseBody(name='body'),
}

/**
 * @summary 批量启用任务
 *
 * @param tmpReq OperateEnableJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OperateEnableJobsResponse
 */
async function operateEnableJobsWithOptions(tmpReq: OperateEnableJobsRequest, runtime: $RuntimeOptions): OperateEnableJobsResponse {
  tmpReq.validate();
  var request = new OperateEnableJobsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.jobIds)) {
    request.jobIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.jobIds, 'JobIds', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.jobIdsShrink)) {
    body['JobIds'] = request.jobIdsShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'OperateEnableJobs',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 批量启用任务
 *
 * @param request OperateEnableJobsRequest
 * @return OperateEnableJobsResponse
 */
async function operateEnableJobs(request: OperateEnableJobsRequest): OperateEnableJobsResponse {
  var runtime = new $RuntimeOptions{};
  return operateEnableJobsWithOptions(request, runtime);
}

model OperateExecuteJobRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  instanceParameters?: string(name='InstanceParameters', example='name=zhangsan'),
  jobId?: long(name='JobId', description='This parameter is required.', example='74'),
  label?: string(name='Label', example='gray'),
  worker?: string(name='Worker', example='http://192.168.1.5:9999/'),
}

model OperateExecuteJobResponseBody = {
  code?: int32(name='Code', example='200'),
  data?: {
    jobExecutionId?: string(name='JobExecutionId', example='1310630367761285120'),
  }(name='Data', description='-'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='6305893D-517D-5131-A767-644EDA81CEC3'),
  success?: boolean(name='Success', example='true'),
}

model OperateExecuteJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OperateExecuteJobResponseBody(name='body'),
}

/**
 * @summary 运行一次任务
 *
 * @param request OperateExecuteJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OperateExecuteJobResponse
 */
async function operateExecuteJobWithOptions(request: OperateExecuteJobRequest, runtime: $RuntimeOptions): OperateExecuteJobResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.instanceParameters)) {
    body['InstanceParameters'] = request.instanceParameters;
  }
  if (!$isNull(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  if (!$isNull(request.label)) {
    body['Label'] = request.label;
  }
  if (!$isNull(request.worker)) {
    body['Worker'] = request.worker;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'OperateExecuteJob',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 运行一次任务
 *
 * @param request OperateExecuteJobRequest
 * @return OperateExecuteJobResponse
 */
async function operateExecuteJob(request: OperateExecuteJobRequest): OperateExecuteJobResponse {
  var runtime = new $RuntimeOptions{};
  return operateExecuteJobWithOptions(request, runtime);
}

model OperateRerunJobRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  dataTime?: string(name='DataTime', description='This parameter is required.', example='14:11:10'),
  endDate?: long(name='EndDate', description='This parameter is required.', example='1698458024000'),
  jobId?: long(name='JobId', description='This parameter is required.', example='74'),
  startDate?: long(name='StartDate', description='This parameter is required.', example='1698458024000'),
}

model OperateRerunJobResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='BCDF4006-C8A1-5F83-9368-588347D3EE84'),
  success?: boolean(name='Success', example='true'),
}

model OperateRerunJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OperateRerunJobResponseBody(name='body'),
}

/**
 * @summary 重刷任务历史数据
 *
 * @param request OperateRerunJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OperateRerunJobResponse
 */
async function operateRerunJobWithOptions(request: OperateRerunJobRequest, runtime: $RuntimeOptions): OperateRerunJobResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!$isNull(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.dataTime)) {
    query['DataTime'] = request.dataTime;
  }
  if (!$isNull(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!$isNull(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'OperateRerunJob',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 重刷任务历史数据
 *
 * @param request OperateRerunJobRequest
 * @return OperateRerunJobResponse
 */
async function operateRerunJob(request: OperateRerunJobRequest): OperateRerunJobResponse {
  var runtime = new $RuntimeOptions{};
  return operateRerunJobWithOptions(request, runtime);
}

model OperateRetryJobExecutionRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobExecutionId?: string(name='JobExecutionId', description='This parameter is required.', example='1310630367761285120'),
  taskList?: [ string ](name='TaskList'),
}

model OperateRetryJobExecutionShrinkRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobExecutionId?: string(name='JobExecutionId', description='This parameter is required.', example='1310630367761285120'),
  taskListShrink?: string(name='TaskList'),
}

model OperateRetryJobExecutionResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='438737AC-760A-57D9-B646-B7EF79426243'),
  success?: boolean(name='Success', example='true'),
}

model OperateRetryJobExecutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OperateRetryJobExecutionResponseBody(name='body'),
}

/**
 * @summary 重跑失败的任务实例
 *
 * @param tmpReq OperateRetryJobExecutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OperateRetryJobExecutionResponse
 */
async function operateRetryJobExecutionWithOptions(tmpReq: OperateRetryJobExecutionRequest, runtime: $RuntimeOptions): OperateRetryJobExecutionResponse {
  tmpReq.validate();
  var request = new OperateRetryJobExecutionShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.taskList)) {
    request.taskListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.taskList, 'TaskList', 'json');
  }
  var query = {};
  if (!$isNull(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!$isNull(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.jobExecutionId)) {
    query['JobExecutionId'] = request.jobExecutionId;
  }
  if (!$isNull(request.taskListShrink)) {
    query['TaskList'] = request.taskListShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'OperateRetryJobExecution',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 重跑失败的任务实例
 *
 * @param request OperateRetryJobExecutionRequest
 * @return OperateRetryJobExecutionResponse
 */
async function operateRetryJobExecution(request: OperateRetryJobExecutionRequest): OperateRetryJobExecutionResponse {
  var runtime = new $RuntimeOptions{};
  return operateRetryJobExecutionWithOptions(request, runtime);
}

model OperateStopJobExecutionRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobExecutionId?: string(name='JobExecutionId', description='This parameter is required.', example='1310630367761285120'),
  taskList?: [ string ](name='TaskList'),
}

model OperateStopJobExecutionShrinkRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  jobExecutionId?: string(name='JobExecutionId', description='This parameter is required.', example='1310630367761285120'),
  taskListShrink?: string(name='TaskList'),
}

model OperateStopJobExecutionResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter check error'),
  requestId?: string(name='RequestId', example='E82D8B33-204D-58E1-8F56-909F6B48F3D1'),
  success?: boolean(name='Success', example='true'),
}

model OperateStopJobExecutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OperateStopJobExecutionResponseBody(name='body'),
}

/**
 * @summary 停止正在运行的任务实例
 *
 * @param tmpReq OperateStopJobExecutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OperateStopJobExecutionResponse
 */
async function operateStopJobExecutionWithOptions(tmpReq: OperateStopJobExecutionRequest, runtime: $RuntimeOptions): OperateStopJobExecutionResponse {
  tmpReq.validate();
  var request = new OperateStopJobExecutionShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.taskList)) {
    request.taskListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.taskList, 'TaskList', 'json');
  }
  var query = {};
  if (!$isNull(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!$isNull(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.jobExecutionId)) {
    query['JobExecutionId'] = request.jobExecutionId;
  }
  if (!$isNull(request.taskListShrink)) {
    query['TaskList'] = request.taskListShrink;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'OperateStopJobExecution',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 停止正在运行的任务实例
 *
 * @param request OperateStopJobExecutionRequest
 * @return OperateStopJobExecutionResponse
 */
async function operateStopJobExecution(request: OperateStopJobExecutionRequest): OperateStopJobExecutionResponse {
  var runtime = new $RuntimeOptions{};
  return operateStopJobExecutionWithOptions(request, runtime);
}

model UpdateAppRequest {
  accessToken?: string(name='AccessToken', example='f312159702f4469585586ed5a6904163v3'),
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  enableLog?: boolean(name='EnableLog', example='true'),
  maxConcurrency?: int32(name='MaxConcurrency', example='10'),
  title?: string(name='Title', description='This parameter is required.'),
}

model UpdateAppResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='39AA91C1-7BB7-5934-B15B-FD8E706D76C4'),
  success?: boolean(name='Success', example='true'),
}

model UpdateAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAppResponseBody(name='body'),
}

/**
 * @summary 更新应用分组
 *
 * @param request UpdateAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAppResponse
 */
async function updateAppWithOptions(request: UpdateAppRequest, runtime: $RuntimeOptions): UpdateAppResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.accessToken)) {
    body['AccessToken'] = request.accessToken;
  }
  if (!$isNull(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.enableLog)) {
    body['EnableLog'] = request.enableLog;
  }
  if (!$isNull(request.maxConcurrency)) {
    body['MaxConcurrency'] = request.maxConcurrency;
  }
  if (!$isNull(request.title)) {
    body['Title'] = request.title;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateApp',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新应用分组
 *
 * @param request UpdateAppRequest
 * @return UpdateAppResponse
 */
async function updateApp(request: UpdateAppRequest): UpdateAppResponse {
  var runtime = new $RuntimeOptions{};
  return updateAppWithOptions(request, runtime);
}

model UpdateClusterRequest {
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-c20f7ec9a78'),
  clusterName?: string(name='ClusterName', description='This parameter is required.', example='xx-test-1107'),
}

model UpdateClusterResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='EEF9AF15-AEEF-5E59-BF7B-BCBB119DC53F'),
  success?: boolean(name='Success', example='true'),
}

model UpdateClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateClusterResponseBody(name='body'),
}

/**
 * @summary 更新集群
 *
 * @param request UpdateClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateClusterResponse
 */
async function updateClusterWithOptions(request: UpdateClusterRequest, runtime: $RuntimeOptions): UpdateClusterResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.clusterName)) {
    query['ClusterName'] = request.clusterName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateCluster',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新集群
 *
 * @param request UpdateClusterRequest
 * @return UpdateClusterResponse
 */
async function updateCluster(request: UpdateClusterRequest): UpdateClusterResponse {
  var runtime = new $RuntimeOptions{};
  return updateClusterWithOptions(request, runtime);
}

model UpdateJobRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  attemptInterval?: int32(name='AttemptInterval', example='3'),
  calendar?: string(name='Calendar', example='workday'),
  childJobId?: string(name='ChildJobId'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  description?: string(name='Description', example='test'),
  executorBlockStrategy?: int32(name='ExecutorBlockStrategy', example='1'),
  jobHandler?: string(name='JobHandler', example='testJobVoidHandler'),
  jobId?: long(name='JobId', description='This parameter is required.', example='74'),
  maxAttempt?: int32(name='MaxAttempt', example='3'),
  maxConcurrency?: int32(name='MaxConcurrency', example='1'),
  name?: string(name='Name', example='test-job'),
  noticeConfig?: {
    failEnable?: boolean(name='FailEnable', example='true'),
    failLimitTimes?: int32(name='FailLimitTimes', example='true'),
    missWorkerEnable?: boolean(name='MissWorkerEnable', example='true'),
    sendChannel?: string(name='SendChannel', example='webhook,sms,mail,phone'),
    successNotice?: boolean(name='SuccessNotice', example='true'),
    timeout?: long(name='Timeout', example='90'),
    timeoutEnable?: boolean(name='TimeoutEnable', example='true'),
    timeoutKillEnable?: boolean(name='TimeoutKillEnable', example='true'),
  }(name='NoticeConfig'),
  noticeContacts?: [ 
    {
      contactType?: int32(name='ContactType', example='1'),
      name?: string(name='Name', example='xiaoming'),
    }
  ](name='NoticeContacts'),
  parameters?: string(name='Parameters', example='test'),
  priority?: int32(name='Priority', example='10'),
  routeStrategy?: int32(name='RouteStrategy', example='1'),
  startTime?: long(name='StartTime', example='1716902187'),
  timeExpression?: string(name='TimeExpression', example='0 0 4 ? * Mon/1'),
  timeType?: int32(name='TimeType', example='1'),
  timezone?: string(name='Timezone', example='Asia/Beijing'),
}

model UpdateJobShrinkRequest {
  appName?: string(name='AppName', description='This parameter is required.', example='test-app'),
  attemptInterval?: int32(name='AttemptInterval', example='3'),
  calendar?: string(name='Calendar', example='workday'),
  childJobId?: string(name='ChildJobId'),
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='xxljob-b6ec1xxxx'),
  description?: string(name='Description', example='test'),
  executorBlockStrategy?: int32(name='ExecutorBlockStrategy', example='1'),
  jobHandler?: string(name='JobHandler', example='testJobVoidHandler'),
  jobId?: long(name='JobId', description='This parameter is required.', example='74'),
  maxAttempt?: int32(name='MaxAttempt', example='3'),
  maxConcurrency?: int32(name='MaxConcurrency', example='1'),
  name?: string(name='Name', example='test-job'),
  noticeConfigShrink?: string(name='NoticeConfig'),
  noticeContactsShrink?: string(name='NoticeContacts'),
  parameters?: string(name='Parameters', example='test'),
  priority?: int32(name='Priority', example='10'),
  routeStrategy?: int32(name='RouteStrategy', example='1'),
  startTime?: long(name='StartTime', example='1716902187'),
  timeExpression?: string(name='TimeExpression', example='0 0 4 ? * Mon/1'),
  timeType?: int32(name='TimeType', example='1'),
  timezone?: string(name='Timezone', example='Asia/Beijing'),
}

model UpdateJobResponseBody = {
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='Parameter error: content is null.'),
  requestId?: string(name='RequestId', example='3808cf26-dde2-4286-8503-b0a2cd4065a7'),
  success?: boolean(name='Success', example='true'),
}

model UpdateJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateJobResponseBody(name='body'),
}

/**
 * @summary 更新任务信息
 *
 * @param tmpReq UpdateJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateJobResponse
 */
async function updateJobWithOptions(tmpReq: UpdateJobRequest, runtime: $RuntimeOptions): UpdateJobResponse {
  tmpReq.validate();
  var request = new UpdateJobShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.noticeConfig)) {
    request.noticeConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.noticeConfig, 'NoticeConfig', 'json');
  }
  if (!$isNull(tmpReq.noticeContacts)) {
    request.noticeContactsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.noticeContacts, 'NoticeContacts', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!$isNull(request.attemptInterval)) {
    body['AttemptInterval'] = request.attemptInterval;
  }
  if (!$isNull(request.calendar)) {
    body['Calendar'] = request.calendar;
  }
  if (!$isNull(request.childJobId)) {
    body['ChildJobId'] = request.childJobId;
  }
  if (!$isNull(request.clusterId)) {
    body['ClusterId'] = request.clusterId;
  }
  if (!$isNull(request.description)) {
    body['Description'] = request.description;
  }
  if (!$isNull(request.executorBlockStrategy)) {
    body['ExecutorBlockStrategy'] = request.executorBlockStrategy;
  }
  if (!$isNull(request.jobHandler)) {
    body['JobHandler'] = request.jobHandler;
  }
  if (!$isNull(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  if (!$isNull(request.maxAttempt)) {
    body['MaxAttempt'] = request.maxAttempt;
  }
  if (!$isNull(request.maxConcurrency)) {
    body['MaxConcurrency'] = request.maxConcurrency;
  }
  if (!$isNull(request.name)) {
    body['Name'] = request.name;
  }
  if (!$isNull(request.noticeConfigShrink)) {
    body['NoticeConfig'] = request.noticeConfigShrink;
  }
  if (!$isNull(request.noticeContactsShrink)) {
    body['NoticeContacts'] = request.noticeContactsShrink;
  }
  if (!$isNull(request.parameters)) {
    body['Parameters'] = request.parameters;
  }
  if (!$isNull(request.priority)) {
    body['Priority'] = request.priority;
  }
  if (!$isNull(request.routeStrategy)) {
    body['RouteStrategy'] = request.routeStrategy;
  }
  if (!$isNull(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!$isNull(request.timeExpression)) {
    body['TimeExpression'] = request.timeExpression;
  }
  if (!$isNull(request.timeType)) {
    body['TimeType'] = request.timeType;
  }
  if (!$isNull(request.timezone)) {
    body['Timezone'] = request.timezone;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateJob',
    version = '2024-06-24',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新任务信息
 *
 * @param request UpdateJobRequest
 * @return UpdateJobResponse
 */
async function updateJob(request: UpdateJobRequest): UpdateJobResponse {
  var runtime = new $RuntimeOptions{};
  return updateJobWithOptions(request, runtime);
}

